<ion-header-bar class="bar-top text-center">
    <div class="buttons">
        <nav-button class="back" ng-click="back()"></nav-button>
    </div>
    <h1 class="title">今日义诊</h1>
</ion-header-bar>
<ion-view>
    <ion-content class="clinic clinic-list" scroll="false">
        <div class="search-box">
            <div class="row">
                <div class="col col-50" ng-class="{'selected':vm.flag==1}" ng-click="vm.menu(1)">
                    <span>科室</span> <i class="down"></i>
                </div>
                <div class="col col-50" ng-class="{'selected':vm.flag==2}" ng-click="vm.menu(2)">
                    <span>排序</span> <i class="down"></i>
                </div>
            </div>
            <ion-list ng-if="vm.flag==1" ng-cloak class="ng-cloak">
            <ion-scroll>
                <ion-item ng-click="vm.departSearch()" ng-class="{'selected':!vm.condition.branchId}">
                    <span>全部科室</span>
                </ion-item>
                <ion-item ng-repeat="depart in vm.departs" ng-click="vm.departSearch(depart.id)" ng-class="{'selected':vm.condition.branchId==depart.id}">
                    <span ng-bind="depart.name"></span>
                </ion-item>
            </ion-scroll>
            </ion-list>
            <ion-list ng-if="vm.flag==2" ng-cloak class="ng-cloak">
            <ion-scroll>
                <ion-item  ng-class="{'selected':vm.condition.sorter=='intelligent'}"  ng-click="vm.sortSearch('intelligent')">
                    <span>智能排序</span>
                </ion-item>
                <ion-item  ng-class="{'selected':vm.condition.sorter=='name'}"  ng-click="vm.sortSearch('name')">
                    <span>医生姓名</span>
                </ion-item>
                <ion-item  ng-class="{'selected':vm.condition.sorter=='hospitalName'}"  ng-click="vm.sortSearch('hospitalName')">
                    <span>医院姓名</span>
                </ion-item>
            </ion-scroll>
            </ion-list>
        </div>
        <div class="clinic-box" ng-class="{'open-search': vm.flag}">
            <div class="shadow"></div>
            <ion-scroll>
                <ion-refresher
                    pulling-text="下拉刷新"
                    on-refresh="vm.doRefresh()"></ion-refresher>
                <ion-list class="clinics">
                    <ion-item ng-repeat="d in vm.data" ng-click="vm.toDetail(d.id)">
                        <div class="row">
                            <div class="col col-33 avatar">
                                <img ng-src="{{downloadImg(d.headImgUrl)}}" alt=""></div>
                            <div class="col col-67 info">
                                <p class="t1">
                                    <span class="name">{{d.name}}</span>
                                    {{d.branchName}} {{d.titleName}}
                                </p>
                                <p class="t">{{d.hospitalName}}</p>
                                <p class="t">{{d.specialty}}</p>
                                <div class="row price">
                                    <div class="col col-20 money">{{d.clinic.callCost}}元</div>
                                    <div class="col col-30 old">原价{{d.callCost}}元</div>
                                    <div class="col col-50 status over">
                                        <a href="javascript:;">还剩{{d.clinic.callCount-d.hadCallCount}}个机会</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </ion-item>
                    <!-- <ion-item>
                    <div class="row">
                        <div class="col col-33 avatar">
                            <img src="img/avatar.png" alt=""></div>
                        <div class="col col-67 info">
                            <p class="t1">
                                <span class="name">许宁宁</span>
                                妇产科 主任医师
                            </p>
                            <p class="t">南京妇幼保健院</p>
                            <p class="t">卵巢囊肿  月经异常  子宫肌瘤</p>
                            <div class="row price">
                                <div class="col col-20 money">1元</div>
                                <div class="col col-30 old">原价6元</div>
                                <div class="col col-50 status over">
                                    <a href="javascript:;">还剩2个机会</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </ion-item>
                <ion-item>
                    <div class="row">
                        <div class="col col-33 avatar">
                            <img src="img/avatar.png" alt=""></div>
                        <div class="col col-67 info">
                            <p class="t1">
                                <span class="name">许宁宁</span>
                                妇产科 主任医师
                            </p>
                            <p class="t">南京妇幼保健院</p>
                            <p class="t">卵巢囊肿  月经异常  子宫肌瘤</p>
                            <div class="row price">
                                <div class="col col-20 money">1元</div>
                                <div class="col col-30 old">原价6元</div>
                                <div class="col col-50 status over">
                                    <a href="javascript:;">还剩2个机会</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </ion-item>
                -->
            </ion-list>
            <ion-infinite-scroll
                    ng-if="!vm.nodata"
                    on-infinite="vm.loadMore()"
                    distance="1%"></ion-infinite-scroll>
        </ion-scroll>
    </div>
</ion-content>
</ion-view>